package com.info.zhiduoduo.repository.mapper.pay;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.info.zhiduoduo.repository.dto.pay.PaymentMerchantDto;
import com.info.zhiduoduo.repository.entity.pay.PaymentMerchant;

import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author bob
 * @since 2020-09-12
 */
public interface PaymentMerchantMapper extends BaseMapper<PaymentMerchant> {

	@Select(" select id,name from zdd_payment_merchant where payment_comp = 3")
	List<PaymentMerchantDto> listZhaoshangMerchant();

	//根据支付方式，查询对应支付公司
	@Select(" select p.id,pm.payment_comp from zdd_payment p " +
			" join zdd_payment_merchant pm on p.source_id = pm.id and p.source_table = 1 " +
			" where p.id = #{payId}")
	PaymentMerchant getPayCompById(Integer payId);
}
